Repository navigation
fix: value-initialize a missing reference dep (#718) - #729
Merged
kris-jusiak merged 7 commits intoOct 17, 2026
Merged
kris-jusiak merged 7 commits into
kris-jusiak merged 7 commits into
Conversation
| struct pool_type_impl<T &, aux::enable_if_t<aux::is_constructible<T>::value && aux::is_constructible<T, const T &>::value>> | ||
| : pool_type_base { | ||
| constexpr explicit pool_type_impl(T &val) : value{val} {} // bind ref directly | ||
| constexpr explicit pool_type_impl(missing_ctor_parameter<T>) : value_{}, value{value_} {}// default-construct backing store |
Contributor
There was a problem hiding this comment.
Suggested change
| constexpr explicit pool_type_impl(missing_ctor_parameter<T>) : value_{}, value{value_} {}// default-construct backing store | |
| constexpr explicit pool_type_impl(missing_ctor_parameter<T>) : value_{}, value{value_} {} // default-construct backing store |
Brace-init from missing_ctor_parameter aggregate-initialized T's first member, ambiguous when that member has a greedy converting ctor like std::expected. A missing vector/string dep is now empty instead of holding one element.
PavelGuzenfeld
force-pushed
the
fix/issue-718-expected-first-member
branch
from
October 14, 2026 12:21
7633853 to
7ec73a0
Compare
dornbirndevelops
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With BOOST_SML_CREATE_DEFAULT_CONSTRUCTIBLE_DEPS a missing
T&dep was built asvalue_{missing_ctor_parameter<T>}. For an aggregate T that initializes the first member from the placeholder, which is ambiguous when the member has a greedy converting ctor like std::expected. Added a ctor overload for missing_ctor_parameter that value-initializes the backing store. Paren-init would also fix #718 but breaks missing vector/string deps.Behaviour change: a missing
std::vector<int>&dep used to hold{0}andstd::string&one\0, now both are empty. Pinned in the test.Test covers a C++14 greedy-ctor member (runs in CI) and std::expected where the library has it. gcc14/15, clang18/21 C++14 through 23, MSVC c++14/20/latest.
Closes #718